import { createApp } from './vue.js';
// const { createApp } = Vue;
createApp({
    data() {
        return {
            list: [
                {
                    id: 0,
                    name: '张三',
                    comment: '今天天气不错',
                    like: 0,
                    time: Date.now(),
                },
                {
                    id: 1,
                    name: '李四',
                    comment: '明天有可能下雨',
                    like: 22,
                    time: Date.now(),
                },
                {
                    id: 2,
                    name: '王五',
                    comment: '今天下雨',
                    like: 12,
                    time: Date.now(),
                },
            ],
            id: '',
            name: '',
            comment: '',
            like: '',
        };
    },
    methods: {
        add() {
            this.list.push({
                id: this.list.length + 1,
                name: 'xxxx',
                comment: this.comment,
                like: 0,
                liked: this.liked,
                time: Date.now(),
            });
            this.comment = '';
        },
        top(item, index) {
            this.list.unshift(item);
            this.list.splice(index + 1, 1);
        },
        del(item, index) {
            this.list.splice(index, 1);
        },
    },
}).mount('#app');
